home *** CD-ROM | disk | FTP | other *** search
- /* TM.c
- This is the Time Manager dcmd.
-
- Copyright © 1988 Apple Computer, Inc. All rights reserved.
-
- Modification history:
- 13MAR93 BRS written from VBL.
-
- The following MPW commands will build the dcmd and copy it to the
- "Debugger Prefs" file in the System folder. The dcmd's name in
- MacsBug will be the name of the file built by the Linker.
- You must first copy dcmd.h, dcmdGlue.a.o and DRunTime.o from the
- C Samples folder into this folder.
-
- C TM.c
- Link dcmdGlue.a.o TM.c.o put.c.o DRuntime.o "{Libraries}"Interface.o -o TM
- BuildDcmd TM 1234
- Echo 'include "TM";' | Rez -a -o "{systemFolder}Debugger Prefs"
- */
-
- #include <Types.h>
- #include <OSUtils.h>
- #include <Timer.h>
-
- #include "dcmd.h"
- #include "put.h"
-
- #define TimeMgrQueue (TMTask*)0xB30
-
- static void DrawHdr()
- {
- // 1 2 3 4 5 6 7
- // 1234567890123456789012345678901234567890123456789012345678901234567890
- dcmdDrawLine("\p tmAddr tmCount tmWakeUp TMTask");
- }
-
-
- static void DrawTimeTask(TMTask* tmt)
- {
- PutUHexZTo((unsigned long)tmt->tmAddr,8,8);
- PutSpace();
- PutSpace();
- PutUHexZTo((unsigned long)tmt->tmCount,8,8);
- PutSpace();
- PutSpace();
- PutUHexZTo((unsigned long)tmt->tmWakeUp,8,8);
- PutSpace();
- PutUHexZTo((unsigned long)tmt,8,8);
- PutLine();
- }
-
-
- pascal void CommandEntry(dcmdBlock* paramPtr)
- {
- switch (paramPtr->request)
- {
- case dcmdInit:
- break;
-
- case dcmdHelp:
- dcmdDrawLine("\pTM - Displays Time Manager Task List");
- break;
-
- case dcmdDoIt:
- {
- TMTask* tmt;
- int numtasks = 0;
-
- dcmdSwapWorlds();
-
- dcmdDrawLine("\pDisplaying Time Manager tasks");
-
- tmt = (TimeMgrQueue);
- tmt = (TMTask*)(*(long*)tmt);
-
- DrawHdr();
- while (tmt)
- {
- DrawTimeTask(tmt);
- numtasks++;
- if (paramPtr->aborted)
- break;
- tmt = (TMTask*)tmt->qLink;
- }
-
- PutUDec(numtasks);
- PutPStr("\p Time Manager tasks");
- PutLine();
-
- dcmdSwapWorlds();
- }
- break;
-
- default:
- PutPStr("\pdon't know what you mean friend! ");
- PutUDec(paramPtr->request);
- PutLine();
- break;
- }
- } // CommandEntry
-